package com.example.springbootjson.parser;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;

import java.io.IOException;

public class KsDmpSourceSerialize extends JsonSerializer<String> {
    public KsDmpSourceSerialize() {
        System.out.println("KsDmpSourceSerialize init");
    }

    @Override
    public void serialize(String s, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
        jsonGenerator.writeString("小刚");
    }
}
